package com.example.tacocloudmessagingkafka;

import com.example.tacoclouddomain.Order;
import org.apache.kafka.common.protocol.types.Field;
import org.springframework.kafka.core.KafkaTemplate;

public class KafkaOrderMessagingService implements OrderMessagingService{

    private KafkaTemplate<String, Order> kafka;

    public KafkaOrderMessagingService(KafkaTemplate<String, Order> kafka) {
        this.kafka = kafka;
    }

    @Override
    public void sendOrder(Order order) {
        kafka.send("tacocloud.orders.topic", order);
    }
}
